package com.baitiaojun.user.service;

import com.baitiaojun.api.domain.user.FollowingGroup;
import com.baitiaojun.api.domain.user.UserFollowing;
import com.baitiaojun.api.exception.ConditionException;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;

/**
 * @类名 UserFollowingService
 * @作者 白条君
 * @创建日期 2022/10/29 19:35
 * @版本 1.0
 */
public interface UserFollowingService {

    void addAndUpdateUserFollowing(UserFollowing userFollowing, String token) throws Exception;

    Object getUserFollowings(String token, UserFollowing userFollowing) throws Exception;

    List<FollowingGroup> getUserFollowings(UserFollowing userFollowing) throws Exception;

    void cancelUserFollowing(Long currentUserId, UserFollowing userFollowing, String token) throws Exception;

    <T> Set<Long> collectUserFollowing(Function<? super T, ? extends Long> mapper, List<T> list);

    List<UserFollowing> getUserFollowingsInThisGroup(Long id);

    void batchMoveUserFollowingGroup(List<Long> ids, Long groupId) throws ConditionException;

    Integer getFollowingCount(Long userId);

    Set<Long> getUserFollowingIdsByUserId(Long userId);

    Set<Long> getFollowingUserIdsByUserId(Long userId) throws ConditionException;
}